package org.summer.generator.writer.impl;

import org.summer.generator.handler.FileCreateHandler;
import org.summer.generator.log.Logger;
import org.summer.generator.log.LoggerManager;
import org.summer.generator.writer.AbstractFileWriter;
import org.summer.generator.writer.WriterToResource;

/**
 * react store 仓库切片文件写入处理类
 */
@WriterToResource(suffix = "Reducer", extension = FileCreateHandler.REACT_TS_FILE_EXTENSION,toTest = true)
public class TypescriptReduxReducerFileWriter extends AbstractFileWriter {
    private static final Logger log = LoggerManager.getLogger(TypescriptReduxReducerFileWriter.class);
    @Override
    public void execute() {
        log.debug("---------------->");
        channel.writerNewline("import {Space} from \"antd\";");
//        channel.writerNewline("import {ColumnsType} from \"antd/es/table\";");
//        channel.writerNewline("import {%s} from \"@/type/%s\";".formatted(table.getTableUpperName(),table.getTableUpperName()));
//        channel.writerEmptyLine();
//        channel.writerNewline("const %s: ColumnsType<%s> = ["
//                .formatted(table.getTableLowerName(),table.getTableUpperName()));
//        channel.writerNewline("""
//                    {
//                        key: 'index',
//                        dataIndex: 'index',
//                        title: '序号',
//                        width: 60,
//                        align: "center",
//                        render: (_:any, __:any, index: number) => <strong> {index + 1} </strong>
//                    },
//                """);
//        channel.writerNewline("ssss");
    }
}
